/** @namespace app.model.File */
module.exports = app => {
  const {STRING, INTEGER, BOOLEAN} = app.Sequelize;

  const File = app.model.define('file', {
    file: {type: STRING, unique: 'file'},
    name: {type: STRING},
    size: {type: INTEGER(11).UNSIGNED, defaultValue: 0},
    selected: {type: BOOLEAN, defaultValue: false},
    deleted: {type: BOOLEAN, defaultValue: false},
  }, {
    updatedAt: false,
    defaultScope: {
      where: {deleted: false},
    },
  });

  return File;
};